<template>
  <div class="wrapper">
    <!-- <h1>{{$route.meta.title}}</h1> -->

    <el-container class="home-container">
      <el-header class="header">
        <div class="header-left">
          <img src="../assets/home_page2.png" alt />
          <span>大妈数据中心</span>
        </div>
        <el-button type="primary" @click="logout">退出登录</el-button>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            background-color="#333744"
            text-color="#fff"
            active-text-color="#ffd04b"
            :router="true"
          >
              <el-submenu index="1">
                <template slot="title">系统设置</template>
                <el-menu-item index="/main/home">首页</el-menu-item>
              </el-submenu>
              <el-submenu index="2">
                <template slot="title">数据统计</template>
                <el-menu-item index="/main/ActivityList">活动列表</el-menu-item>
              </el-submenu>
              <el-submenu index="3">
                <template slot="title">选项4</template>
                <el-menu-item index="3-1">选项1</el-menu-item>
              </el-submenu>
            
          </el-menu>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
import { removeCookie } from "@/lib/utils";
import Setting from "@/Setting";
export default {
  data() {
    return {
      title: "Home"
    };
  },
  methods: {
    logout() {
      let flag = removeCookie(Setting.tokenName);
      this.$router.push({name:'login'});
    }
  },
  created() {}
};
</script>
<style lang="less" scoped>
.el-header {
  background-color: #373d41;
}
.el-aside {
  background-color: #333744;
}
.el-main {
  background-color: #eaedf1;
}
.home-container {
  height: 100%;
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 0;
  > div.header-left {
    display: flex;
    align-items: center;
    margin-left: 10px;
    img {
      margin-right: 5px;
      width: 43px;
    }
    span {
      color: #fff;
    }
  }
}
.el-menu{
    width: 100%;
}
</style>
